home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk7
/
rxutil
/
sizeblk.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-18
|
734b
|
30 lines
/* Sizeblk.rexx Shows recursive function. -Dave Haynie */
call addlib("rexxsupport.library",0,-30,0)
parse arg dir .
blocks = countblock(dir)
/* say 'Total of' blocks 'blocks in directory' '9b'x'3m'dir'9b'x'0m' */
say blocks 'blocks in directory: ' dir
exit
countblock : procedure
arg dir
blocks = 0
files = showdir(dir,'file')
dirs = showdir(dir,'dir')
call pragma 'Directory',dir
do while files ~= ''
parse var files oner .
files = delword(files,1,1)
blocks = blocks + subword(statef(oner),3,1) + 1
end
do while dirs ~= ''
parse var dirs oner .
dirs = delword(dirs,1,1)
blocks = blocks + countblock(oner) + 1
end
call pragma 'Directory','/'
return blocks